package org.aurora.module.user.api.facade.request;

import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.aurora.framework.boot.common.rpc.request.RpcRequest;
import org.aurora.module.user.api.facade.validator.UserGroups;

import java.io.Serial;

/**
 * UserRequest
 * <pre>
 * description: 用户查询请求
 * create date: 2025-03-23 17:45:59
 * </pre>
 *
 * @author cao.yong
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class UserRequest implements RpcRequest {
    @Serial
    private static final long serialVersionUID = 1L;

    @NotNull(message = "用户ID不能为空", groups = {UserGroups.Id.class})
    private Long id;

    @NotBlank(message = "用户名不能为空", groups = {UserGroups.UsernameAndPassword.class})
    private String username;

    @NotBlank(message = "用户名不能为空", groups = {UserGroups.TelephoneAndPassword.class})
    private String telephone;

    @NotBlank(message = "用户密码不能为空", groups = {UserGroups.UsernameAndPassword.class, UserGroups.TelephoneAndPassword.class})
    private String password;
}
